var apiTable = [
    {name: 'API_POST_LOGIN', env: 'development', api: 'http://119.147.37.168:9084/api/user/login'},
    {name: 'API_POST_LOGIN', env: 'production', api: 'http://119.147.37.168:9084/api/user/login'},

    {name: 'URL_LOGIN', env: 'development', api: 'http://localhost:8092'},
    {name: 'URL_LOGIN', env: 'production', api: 'http://119.147.37.168:9182'},

    {name: 'URL_INDEX', env: 'development', api: 'http://localhost:8091'},
    {name: 'URL_INDEX', env: 'production', api: 'http://119.147.37.168:9181'},

    {name: 'URL_INDEX_CMS', env: 'development', api: 'http://localhost:8093'},
    {name: 'URL_INDEX_CMS', env: 'production', api: 'http://119.147.37.168:9183'}
];

export const getAPI = function (name) {
    var api = '';
    apiTable.forEach(function(item, index) {
        if (item.name === name && item.env === process.env.NODE_ENV) {
            api = item.api;
        }
    });
    return api;
}
